﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.customer.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.auth.client.OnlineUser;
import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.customer.dao.*;
import com.hh.bss.customer.entity.*;
import com.hh.bss.customer.service.*;
import com.hh.bss.customer.vo.query.*;
import com.hh.bss.util.*;





public class CustomerBd extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CustomerBd";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CUST_ID = "custId";
	public static final String ALIAS_BD_ACCOUNT = "bdAccount";
	public static final String ALIAS_EXPIRED_D = "expiredD";
	public static final String ALIAS_BD_STATUS = "bdStatus";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_EXPIRED_D = DATE_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer custId;
	@NotBlank @Length(max=20)
	private java.lang.String bdAccount;
	
	private java.util.Date expiredD;
	@NotNull @Max(32767)
	private Integer bdStatus;
	
	private java.util.Date createDt;
	
	private java.util.Date modifiedDt;
	private OnlineUser onlineUser;	
	//columns END

	public CustomerBd(){
	}

	public OnlineUser getOnlineUser() {
		return onlineUser;
	}

	public void setOnlineUser(OnlineUser onlineUser) {
		this.onlineUser = onlineUser;
	}

	public CustomerBd(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCustId(java.lang.Integer value) {
		this.custId = value;
	}
	
	public java.lang.Integer getCustId() {
		return this.custId;
	}
	public void setBdAccount(java.lang.String value) {
		this.bdAccount = value;
	}
	
	public java.lang.String getBdAccount() {
		return this.bdAccount;
	}
	public String getExpiredDString() {
		return DateConvertUtils.format(getExpiredD(), FORMAT_EXPIRED_D);
	}
	public void setExpiredDString(String value) {
		setExpiredD(DateConvertUtils.parse(value, FORMAT_EXPIRED_D,java.util.Date.class));
	}
	
	public void setExpiredD(java.util.Date value) {
		this.expiredD = value;
	}
	
	public java.util.Date getExpiredD() {
		return this.expiredD;
	}
	public void setBdStatus(Integer value) {
		this.bdStatus = value;
	}
	
	public Integer getBdStatus() {
		return this.bdStatus;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CustId",getCustId())
			.append("BdAccount",getBdAccount())
			.append("ExpiredD",getExpiredD())
			.append("BdStatus",getBdStatus())
			.append("CreateDt",getCreateDt())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CustomerBd == false) return false;
		if(this == obj) return true;
		CustomerBd other = (CustomerBd)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

